﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Kcadastro.adm
{
    public partial class thread_list : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //TODO: BEGIN Seleciona Link Serviços
            if (this.Master is kcadastro)
            {
                ((kcadastro)this.Page.Master).SelecionaPagina(FW.utils.enumPaginas.Threads);
            }
            //TODO:END
            masterPageKcad m = Master as masterPageKcad;
            m.idFerr = 6;
            if (!IsPostBack)
            {

                carregar();
            }
        }

        private void carregar()
        {
            classes.oss os = new classes.oss();
            rp_threads.DataSource = os.listarThreads();
            rp_threads.DataBind();
            os = null;
        }

        protected void rp_threads_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName =="CNL")
            {
                classes.oss os = new classes.oss();
                os.pararThread(Convert.ToInt16(e.CommandArgument));
                os = null;
                carregar();
            }
        }
    }
}